package com.devtty.collabhr;

import javax.enterprise.inject.Instance;
import javax.inject.Inject;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;

import com.vaadin.Application;
import com.vaadin.terminal.gwt.server.AbstractApplicationServlet;

public class VaadinAppServlet extends AbstractApplicationServlet {

	@Inject
	Instance<MyVaadinApplication> myVaadinApplication;
	
	@Override
	protected Class<? extends Application> getApplicationClass()
			throws ClassNotFoundException {
		return MyVaadinApplication.class;
	}
	
	@Override
	protected Application getNewApplication(HttpServletRequest request) throws ServletException{
		try{
			return myVaadinApplication.get();
		}catch(NullPointerException e){
			e.printStackTrace();
		}
		return null;
	}

}
